﻿using IENMService.Model;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;

namespace IENMService.Service
{
    /// <summary>
    /// 护理管理接口类
    /// </summary>
    public interface IENMInterface
    {
        /// <summary>
        /// 4.1.1.1 获取科室列表
        /// </summary>
        /// <param name="updateTime">数据更新时间</param>
        /// <param name="pageNum">页码</param>
        /// <param name="pageSize">每页显示条数</param>
        /// <returns></returns>
        Task<List<Dept>> getDepts(DateTime updateTime,int pageNum,int pageSize);

        /// <summary>
        /// 4.1.1.2 获取科室类型
        /// </summary>
        /// <param name="updateTime">数据更新时间</param>
        /// <param name="pageNum">页码</param>
        /// <param name="pageSize">每页显示条数</param>
        /// <returns></returns>
        Task<List<DeptType>> getDeptTypes(DateTime updateTime, int pageNum, int pageSize);

        /// <summary>
        /// 4.1.1.3 获取科室与病区关联关系
        /// </summary>
        /// <param name="updateTime">数据更新时间</param>
        /// <param name="pageNum">页码</param>
        /// <param name="pageSize">每页显示条数</param>
        /// <returns></returns>
        Task<List<DeptWardRelation>> getDeptWardRelation(DateTime updateTime, int pageNum, int pageSize);

        /// <summary>
        /// 4.1.1.4 获取职工与科室关系
        /// </summary>
        /// <param name="updateTime">数据更新时间</param>
        /// <param name="pageNum">页码</param>
        /// <param name="pageSize">每页显示条数</param>
        /// <returns></returns>
        Task<List<UsersDept>> getUsersDept(DateTime updateTime, int pageNum, int pageSize);

        /// <summary>
        /// 4.1.1.5 获取职工信息
        /// </summary>
        /// <param name="updateTime">数据更新时间</param>
        /// <param name="pageNum">页码</param>
        /// <param name="pageSize">每页显示条数</param>
        /// <returns></returns>
        Task<List<User>> getUsers(DateTime updateTime, int pageNum, int pageSize);

        /// <summary>
        /// 4.1.1.6 获取职工与角色关系信息
        /// </summary>
        /// <param name="updateTime">数据更新时间</param>
        /// <param name="pageNum">页码</param>
        /// <param name="pageSize">每页显示条数</param>
        /// <returns></returns>
        Task<List<UserRoles>> getUserRoles(DateTime updateTime, int pageNum, int pageSize);

        /// <summary>
        /// 4.1.1.7 获取床位列表信息
        /// </summary>
        /// <param name="deptCode">科室编号</param>
        /// <param name="updateTime">数据更新时间</param>
        /// <param name="pageNum">页码</param>
        /// <param name="pageSize">每页显示条数</param>
        /// <returns></returns>
        Task<List<DeptBeds>> getDeptBeds(string deptCode, DateTime updateTime, int pageNum, int pageSize);

        /// <summary>
        /// 4.1.1.8 获取患者信息
        /// </summary>
        /// <param name="patientId">患者唯一号</param>
        /// <param name="inpNo">住院号</param>
        /// <param name="visitId">入院次数</param>
        /// <param name="inHospital">0：获取全部，1：只获取在院</param>
        /// <param name="deptCode">科室编号</param>
        /// <param name="admissiontime">入院时间</param>
        /// <param name="updateTime">更新时间</param>
        /// <param name="pageNum">页码</param>
        /// <param name="pageSize">每页条数</param>
        /// <returns></returns>
        Task<List<Patient>> getPatients(string? patientId,string? inpNo, int? visitId,string? inHospital, string? deptCode,DateTime? admissiontime, DateTime? updateTime, int pageNum, int pageSize);

        /// <summary>
        /// 4.1.1.9 获取患者转科记录信息
        /// </summary>
        /// <param name="PATIENT_ID">患者唯一编号</param>
        /// <param name="INP_NO">住院号</param>
        /// <param name="VISIT_ID">住院次数</param>
        /// <param name="START_TIME">转入或转出开始时间</param>
        /// <param name="END_TIME">转入或转出结束时间</param>
        /// <param name="UPDATE_TIME">数据更新时间</param>
        /// <param name="PAGENUM">页码</param>
        /// <param name="PAGESIZE">每页显示条数</param>
        /// <returns></returns>
        Task<List<TransferRecord>> getTransferRecord(string? PATIENT_ID,string? INP_NO,string? VISIT_ID,DateTime? START_TIME,DateTime? END_TIME, DateTime? UPDATE_TIME, int PAGENUM, int PAGESIZE);

        /// <summary>
        /// 4.1.1.10 获取患者出院撤回记录
        /// </summary>
        /// <param name="DEPT_CODE">科室编号</param>
        /// <param name="START_TIME">开始时间</param>
        /// <param name="END_TIME">结束时间</param>
        /// <param name="UPDATE_TIME">数据更新时间</param>
        /// <param name="PAGENUM">页码</param>
        /// <param name="PAGESIZE">每页条数</param>
        /// <returns></returns>
        Task<List<PatientLeaveRevoke>> getPatientLeaveRevoke(string? DEPT_CODE, DateTime? START_TIME,DateTime? END_TIME,  DateTime UPDATE_TIME, int PAGENUM, int PAGESIZE);

        /// <summary>
        /// 4.1.1.11 获取医嘱用法信息
        /// </summary>
        /// <param name="UPDATE_TIME">数据更新时间</param>
        /// <param name="PAGENUM">页码</param>
        /// <param name="PAGESIZE">每页条数</param>
        /// <returns></returns>
        Task<List<DoctorAdviceUsage>> getDoctorAdviceUsage(DateTime UPDATE_TIME, int PAGENUM, int PAGESIZE);

        /// <summary>
        /// 4.1.1.12 获取医嘱类型信息
        /// </summary>
        /// <param name="UPDATE_TIME">数据更新时间</param>
        /// <returns></returns>
        Task<List<DoctorAdviceType>> getDoctorAdviceType(DateTime UPDATE_TIME);

        /// <summary>
        /// 4.1.1.13 获取医嘱类别信息
        /// </summary>
        /// <param name="UPDATE_TIME">数据更新时间</param>
        /// <returns></returns>
        Task<List<DoctorAdviceCategory>> getDoctorAdviceCategory(DateTime UPDATE_TIME);

        /// <summary>
        /// 4.1.1.14 获取医嘱状态信息
        /// </summary>
        /// <param name="UPDATE_TIME">数据更新时间</param>
        /// <returns></returns>
        Task<List<DoctorAdviceStatus>> getDoctorAdviceStatus(DateTime UPDATE_TIME);

        /// <summary>
        /// 4.1.1.15 获取医嘱频次信息
        /// </summary>
        /// <param name="UPDATE_TIME">数据更新时间</param>
        /// <returns></returns>
        Task<List<DoctorAdviceFrequency>> getDoctorAdviceFrequency(DateTime UPDATE_TIME);

        /// <summary>
        /// 4.1.1.16 获取医嘱详细信息
        /// </summary>
        /// <param name="DOCTOR_ADVICE_ID">医嘱号，支持多个用逗号拼接</param>
        /// <param name="INP_NO">住院号</param>
        /// <param name="VISIT_ID">入院次数</param>
        /// <param name="ORDERING_DEPT_CODE">开单科室编号</param>
        /// <param name="STARTTIME_FROM">医嘱开始时间（检索开始时间）</param>
        /// <param name="STARTTIME_TO">医嘱开始时间（检索结束时间）</param>
        /// <param name="ISENABLE">是否启用，1 是，0 否,默认全部</param>
        /// <param name="ISSTOP">是否停止，1 是，0 否,默认全部</param>
        /// <param name="UPDATE_TIME">数据更新时间</param>
        /// <param name="PAGENUM">页码</param>
        /// <param name="PAGESIZE">每页显示条数</param>
        /// <returns></returns>
        Task<List<DoctorAdvice>> getDoctorAdvice(string? DOCTOR_ADVICE_ID,string? INP_NO,string? VISIT_ID,string? ORDERING_DEPT_CODE, DateTime? STARTTIME_FROM, DateTime? STARTTIME_TO,int? ISENABLE,int? ISSTOP, DateTime? UPDATE_TIME,int PAGENUM, int PAGESIZE);

        /// <summary>
        /// 4.1.1.17 获取疾病名称信息
        /// </summary>
        /// <param name="UPDATE_TIME">数据更新时间</param>
        /// <param name="PAGENUM">页码</param>
        /// <param name="PAGESIZE">每页显示条数</param>
        /// <returns></returns>
        Task<List<ICD10>> getICD10(DateTime UPDATE_TIME, int PAGENUM, int PAGESIZE);

        /// <summary>
        /// 4.1.1.18 获取检验申请信息
        /// </summary>
        /// <param name="APPLY_DEPT_CODE">申请科室编号</param>
        /// <param name="APPLY_DATE_FROM">检验申请开始时间</param>
        /// <param name="APPLY_DATE_TO">检验申请结束时间</param>
        /// <param name="UPDATE_TIME">数据更新时间</param>
        /// <param name="PAGENUM">页码</param>
        /// <param name="PAGESIZE"></param>
        /// <returns></returns>
        Task<List<Examine>> getExamine(string? APPLY_DEPT_CODE,DateTime? APPLY_DATE_FROM,DateTime? APPLY_DATE_TO, DateTime UPDATE_TIME, int PAGENUM, int PAGESIZE);

        /// <summary>
        /// 4.1.1.19 获取检验结果信息
        /// </summary>
        /// <param name="APPLY_DEPT_CODE">病区代码</param>
        /// <param name="APPLY_IDS">申请单号，多个以逗号分隔</param>
        /// <param name="RESULT_DATE_TIME_FROM">检验结果开始时间</param>
        /// <param name="RESULT_DATE_TIME_TO">检验结果结束时间</param>
        /// <param name="UPDATE_TIME">数据更新时间</param>
        /// <param name="PAGENUM">页码</param>
        /// <param name="PAGESIZE">每页显示条数</param>
        /// <returns></returns>
        Task<List<ExamineResult>> getExamineResult(string? APPLY_DEPT_CODE,string? APPLY_IDS, DateTime? RESULT_DATE_TIME_FROM, DateTime? RESULT_DATE_TIME_TO, DateTime UPDATE_TIME, int PAGENUM, int PAGESIZE);

        /// <summary>
        /// 4.1.1.20 获取检查申请和报告信息
        /// </summary>
        /// <param name="APPLY_DEPT_CODE">开单科室编号</param>
        /// <param name="APPLY_DATE_FROM">检查申请开始时间</param>
        /// <param name="APPLY_DATE_TO">检查申请结束时间</param>
        /// <param name="INP_NO">住院号</param>
        /// <param name="VISIT_ID">住院次数</param>
        /// <param name="APPLY_ID">申请单编号</param>
        /// <param name="PAGENUM">页码</param>
        /// <param name="PAGESIZE">每页显示条数</param>
        /// <returns></returns>
        Task<List<Inspect>> getInspect(string? APPLY_DEPT_CODE, DateTime? APPLY_DATE_FROM, DateTime? APPLY_DATE_TO, string? INP_NO,int? VISIT_ID, string? APPLY_ID, int PAGENUM, int PAGESIZE);

        /// <summary>
        /// 4.1.1.21 获取临床诊疗项目
        /// </summary>
        /// <param name="UPDATE_TIME">数据更新时间</param>
        /// <param name="PAGENUM">页码</param>
        /// <param name="PAGESIZE">每页显示条数</param>
        /// <returns></returns>
        Task<List<ClinicalProject>> getClinicalProject(DateTime UPDATE_TIME, int PAGENUM, int PAGESIZE);

        /// <summary>
        /// 4.1.1.22 获取新生儿信息
        /// </summary>
        /// <param name="MOTHER_INP_NO">母亲住院号，多个以逗号分隔</param>
        /// <param name="DEPT_CODE">科室编号</param>
        /// <param name="UPDATE_TIME">数据更新时间</param>
        /// <param name="PAGENUM">页码</param>
        /// <param name="PAGESIZE">每页显示条数</param>
        /// <returns></returns>
        Task<List<Baby>> getBabies(string? MOTHER_INP_NO,string? DEPT_CODE, DateTime UPDATE_TIME, int PAGENUM, int PAGESIZE);

        /// <summary>
        /// 4.1.1.23 获取药品目录
        /// </summary>
        /// <param name="UPDATE_TIME">数据更新时间</param>
        /// <param name="PAGENUM">页码</param>
        /// <param name="PAGESIZE">每页显示条数</param>
        /// <returns></returns>
        Task<List<DrugDictionary>> getDrugDictionary(DateTime UPDATE_TIME, int PAGENUM, int PAGESIZE);

        /// <summary>
        /// 4.1.1.24 获取换床信息
        /// </summary>
        /// <param name="DEPT_CODE">科室编号</param>
        /// <param name="CHANGE_TIME_FROM">换床开始时间</param>
        /// <param name="CHANGE_TIME_TO">换床结束时间</param>
        /// <param name="INP_NO">住院号</param>
        /// <param name="VISIT_ID">入院次数</param>
        /// <param name="UPDATE_TIME">数据更新时间</param>
        /// <param name="PAGENUM">页码</param>
        /// <param name="PAGESIZE">每页显示条数</param>
        /// <returns></returns>
        Task<List<ChangeBeds>> getTodayChangeBeds(string? DEPT_CODE,DateTime? CHANGE_TIME_FROM,DateTime? CHANGE_TIME_TO,string? INP_NO,int? VISIT_ID, DateTime UPDATE_TIME, int PAGENUM, int PAGESIZE);

        /// <summary>
        /// 4.1.1.25 获取患者撤销入科记录
        /// </summary>
        /// <param name="UPDATE_TIME">数据更新时间</param>
        /// <param name="PAGENUM">页码</param>
        /// <param name="PAGESIZE">每页显示条数</param>
        /// <returns></returns>
        Task<List<OutWardRecord>> getOutWardRecord(DateTime UPDATE_TIME, int PAGENUM, int PAGESIZE);

        /// <summary>
        /// 4.1.2.1. 人员调科
        /// </summary>
        /// <param name="NURSE_CODE"></param>
        /// <param name="TRANFROM_DEPT_CODE"></param>
        /// <param name="TRANTO_DEPT_CODE"></param>
        /// <param name="OPERATOR"></param>
        /// <returns></returns>
        Task<string> transferNurse(string NURSE_CODE, string TRANFROM_DEPT_CODE, string TRANTO_DEPT_CODE, string OPERATOR);

        /// <summary>
        /// 4.1.2.2. 离职/退休/注销:护理人员在离职、退休或账号注销时使用
        /// </summary>
        /// <param name="NURSE_CODE">护理人员编号</param>
        /// <param name="TYPE">1：离职，2：退休，3：注销</param>
        /// <param name="OPERATOR">操作人员</param>
        /// <returns></returns>
        Task<string> logOff(string NURSE_CODE, int TYPE, string OPERATOR);

        /// <summary>
        /// 4.2.1. 获取患者疾病诊断信息
        /// </summary>
        /// <param name="INP_NO"></param>
        /// <param name="VISIT_ID"></param>
        /// <param name="DEPT_CODE"></param>
        /// <param name="DIAGNOSE_TIME_FROM"></param>
        /// <param name="DIAGNOSE_TIME_TO"></param>
        /// <param name="INHOSPITAL"></param>
        /// <param name="PAGENUM"></param>
        /// <param name="PAGESIZE"></param>
        /// <returns></returns>
        Task<List<Diagnose>> getDiagnose(string? INP_NO, int? VISIT_ID, string? DEPT_CODE, DateTime? DIAGNOSE_TIME_FROM, DateTime? DIAGNOSE_TIME_TO, int? INHOSPITAL, int PAGENUM, int PAGESIZE);

        /// <summary>
        /// 4.3.1. 按日期查询患者 apache2 评分
        /// </summary>
        /// <param name="date"></param>
        /// <param name="pageNum"></param>
        /// <param name="pageSize"></param>
        /// <param name="hospitalId"></param>
        /// <param name="appKey"></param>
        /// <returns></returns>
        Task<ActionResult> apache2Score(string date, int pageNum, int pageSize, string hospitalId, string appKey);

        /// <summary>
        /// 4.3.2. 患者 apache2 评分
        /// </summary>
        /// <param name="date"></param>
        /// <param name="pageNum"></param>
        /// <param name="pageSize"></param>
        /// <param name="hospitalId"></param>
        /// <param name="appKey"></param>
        /// <returns></returns>
        Task<ActionResult> apacheScore(string date, int pageNum, int pageSize, string hospitalId, string appKey);
    }
}
